<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/taglib/cw" prefix="CW" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title></title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--通用js  -->
<script type="text/javascript" src="<%=basePath%>js/commons/common_list.js"></script>
<!--系统css  -->
<link href="<%=basePath%>css/en/list.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
/**
 * 删除操作。
 */
function delEntity(id) {
	art.dialog.confirm('确认删除所选项', function(){
	$("#loadingdiv").show();
		document.formPublisher.action="<%=basePath%>/logmanager/delete.action?LogId="+id;
		document.formPublisher.submit();
	}, function(){
	    art.dialog.tips('取消操作');
	});
}
//批量删除
function delBatchEntity(isDel){
	var ids = getCheckedValue(); 
	if(ids==""||ids==null){
		art.dialog.tips('请至少选择一项');
	}else{
		art.dialog.confirm('确认删除所选项', function(){
		$("#loadingdiv").show();
			document.formPublisher.action="<%=basePath%>/logmanager/deleteBatch.action?LogIds="+ids;
			document.formPublisher.submit();
		}, function(){
		    art.dialog.tips('取消操作');
		});
	}
}
$(document).ready(function(){
  //显示操作结果
	 var actionResult = $("#actionResult").val();
	 if(actionResult=="success"){
		art.dialog.tips('操作成功');
	 }else if(actionResult=="error"){
	 	art.dialog.tips('操作失败');
	 }
}); 
//刷新页面
function _resresh(){
	_reset();
	document.formPublisher.action="<%=basePath%>/logmanager/findList.action";
	document.formPublisher.submit();
}
//条件查询
function _search(){
$("#loadingdiv").show();
	document.formPublisher.action="<%=basePath%>/logmanager/findList.action";
	document.formPublisher.submit();
}
//重置查询条件
function _reset(){
	$("#LogLevel").val("");
	$("#OperatObject").val("");
	$("#LogType").val("");
	$("#OperatResult").val("");
	$("#OperatTimeStart").val("");
	$("#OperatTimeEnd").val("");
}
</script>
</head>
<body >
<form method="post" id="formPublisher" name="formPublisher" action="<%=basePath%>/logmanager/findList.action" >
<jsp:include page="../../../common/loadingPage.jsp" />
<s:hidden name="actionResult" id="actionResult"  ></s:hidden>
<div class="pageheader">
	<div class="pagetitle">
	<!-- 模块名称  -->
	系统操作
	</div>
	<!-- 列表头 -->
	<div class="pageheadercontent">
		<!-- 查询条件 -->
		<table class="searchtbl">
			<tr>
	            <th width="15%">
	            	模块名称：
	            </th>
	            <td width="18%">
	           		<input type="text" name="logmanager.OperatObject" id="OperatObject" value="<s:property value="logmanager.OperatObject" />">
	            </td>
	            <th width="15%">操作等级：</th>
	           	   <td width="18%">
            		<select name="logmanager.LogLevel" id="LogLevel">
		            	<option value="" selected="selected"></option>
		                <option value="1" <s:if test="logmanager.LogLevel==1">selected='selected'</s:if>>1</option>
		                <option value="2" <s:if test="logmanager.LogLevel==2">selected='selected'</s:if>>2</option>
		                <option value="3" <s:if test="logmanager.LogLevel==3">selected='selected'</s:if>>3</option>
		                <option value="4" <s:if test="logmanager.LogLevel==4">selected='selected'</s:if>>4</option>
		                <option value="5" <s:if test="logmanager.LogLevel==5">selected='selected'</s:if>>5</option>
	           		</select>
	            </td>
           	</tr>
           	<tr>
                <th width="15%">操作结果：</th>
	            <td width="18%">
            		<select name="logmanager.OperatResult" id="OperatResult">
		            	<option value="" selected="selected"></option>
		            	<option value="-1" <s:if test="logmanager.OperatResult==-1">selected='selected'</s:if>>操作失败</option>
		                <option value="1" <s:if test="logmanager.OperatResult==1">selected='selected'</s:if>>操作成功</option>
	           		</select>
	            </td>
	            <th width="15%">
                	操作时间：</th>
	            <td width="18%" style="text-align: left">
            		<input id="OperatTimeStart" name="logmanager.OperatTimeStart" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'OperatTimeEnd\')}'});" readonly="readonly" type="text" class="Wdate" value="<s:property value="logmanager.OperatTimeStart" />" style="width:45%"/> 
            		-
	            	<input id="OperatTimeEnd" name="logmanager.OperatTimeEnd" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-%d',minDate:'#F{$dp.$D(\'OperatTimeStart\')}'});" readonly="readonly" type="text" class="Wdate" value="<s:property value="logmanager.OperatTimeEnd" />" style="width:45%"/> 
	            </td>
            </tr>
			<tr>
				<td colspan="6" style="text-align: center;">
				<input type="button" class="searchbtn" value="搜索" onclick="_search()">
             	<input type="button" class="resetbtn" value="重置" onclick="_reset()">
				</td>
			</tr>
		</table>
		<!-- 工具栏 -->
		<div class="toolbar">
			<!-- 操作 -->
			<div class="toolbarright">
				<input name="delete" type="button" value="删除" class="delbtn" onclick="delBatchEntity('del');return false;">
				<input name="refresh" type="button" value="刷新" class="refbtn" onclick="_resresh();return false;">
			</div>
		</div>
	</div>
</div>
<table class="gridview tablesorter" cellpadding="0" cellspacing="0" width="100%">
	<thead>
	<tr  class="gridview_color">
        <th width="5%">
        <input type="checkbox" name="chk_all" id="chk_all"  />
        </th>
        <th>模块名称</th>
        <th>操作种类</th>
        <th>操作级别</th>
        <th>操作人</th>
        <th>IP地址</th>
        <th>操作结果</th>
        <th>操作时间</th>
        <th>备注</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <s:if test="page.resultList.size()>0">
        <s:iterator value="page.resultList" var="publisher" status="status">
        <s:if test="%{#status.count%2 == 0}">
		<tr class="gridview_color">
		</s:if>
            <td><input type="checkbox" name="chk_list" id="chk_list_<s:property value="#status.count" />" value="<s:property value="LogId" />"/>
            </td>
            <td title="<s:property value="OperatObject" />"><s:property value="OperatObject" /></td>
            <td title="<s:property value="LogType" />"><s:property value="LogType" /></td>
            <td title="<s:property value="LogLevel" />"><s:property value="LogLevel" /></td>
            <td><CW:dataValue property="CreatePerson" field="CreatePerson" person="true"></CW:dataValue></td>
            <td title="<s:property value="OperatIp" />"><s:property value="OperatIp" /></td>
            <td><s:if test="%{OperatResult == 0}"><s:text name="list_operationfailed" /></s:if><s:if test="%{OperatResult == 1}"><s:text name="list_successfuloperation" /></s:if></td>
            <td title="<s:date name="OperatTime" format="yyyy/MM/dd HH:mm:ss" />"><s:date name="OperatTime" format="yyyy/MM/dd HH:mm:ss" /></td>
            <td title="<s:property value="LogMessage" />"><s:property value="LogMessage" /></td>
            <td>
            <a href="#" onclick="delEntity('<s:property value="LogId" />');return false;">删除</a>
            </td>
        </tr>
        </s:iterator>
    </s:if>
    </tbody>
</table>
<s:else>
	<jsp:include page="../../nullPage.jsp" />
</s:else>
<!--分页条-->
<CW:page property="page" url="/logmanager/findList.action"></CW:page>
</form>
<span class="_height"></span>
</body>
</html>
